import { get, post, put, del } from './uni_request'

/*
 * 跟课程相关的API方法
 */
const model_course = '/app/'

const model_currency = '/'

/**
 * 课程分类
 */
export const getCourseTypeList = function(params) {
	return get(model_course + 'course/classList', params)
}

/**
 * 课程列表
 */
export const getCourseList = function(params) {
	return get(model_course + 'index/courseList', params)
}

/**
 * 课程详情
 */
export const getDetail = function(params) {
	return get(model_course + 'course/detail', params)
}

/**
 * 查询课程排课
 */
export const getCourseDateList = function(params) {
	return get(model_course + 'course/courseSchedule', params)
}

/**
 * 添加约课操作
 */
export const putCourseAbout = function(params) {
	return post(model_course + 'course/about', params)
}

/**
 * 取消约课操作
 */
export const delCourseAbout = function(params) {
	return post(model_course + 'user/cancelAbout', params)
}

/**
 * 轮播列表1
 */
export const getCycleList = function(params) {
	return get(model_course + `index/cycleList`, params)
}

/**
 * 轮播列表2
 */
export const getBannerList = function(params) {
	return get(model_course + `index/bannerList`, params)
}

/**
 * 获取openId
 */
export const getWxOpenId = function(params) {
	return get(model_course + `user/getWxOpenId`, params)
}

/**
 * 获取手机号
 */
export const getWxPhone = function(params) {
	return post(model_course + `user/getWxPhone`, params)
}

/**
 * 登录
 */
export const login = function(params) {
	return post(model_course + `user/login`, params)
}

/**
 * openid登录
 */
export const quickLogin = function(params) {
	return post(model_course + `user/quickLogin`, params)
}

/**
 * 创建订单
 */
export const createOrder = function(params) {
	return post(model_course + `course/order`, params)
}

/**
 * 微信支付
 */
export const wxPay = function(params) {
	return get(model_course + `wx/pay`, params)
}

/**
 * 支付回调
 */
export const wxpayCall = function(params) {
	return post(model_course + `wx/wxPayNotify`, params)
}

/**
 * 订单列表
 */
export const orderList = function(params) {
	return get(model_course + `user/orderList`, params)
}

/**
 * 订单详情
 */
export const orderDetail = function(params) {
	return get(model_course + `course/orderDetail`, params)
}

/**
 * 取消订单
 */
export const cancelOrder = function(params) {
	return post(model_course + `course/cancelOrder`, params)
}

/**
 * 活动分类
 */
export const getActivityClasses = function(params) {
	return get(model_course + `Activity/classList`, params)
}
/**
 * 活动列表
 */
export const getActivityList = function(params) {
	return get(model_course + `Activity/list`, params)
}
/**
 * 活动详情
 */
export const getActivityDetail = function(params) {
	return get(model_course + `Activity/detail`, params)
}
/**
 * 活动报名
 */
export const createActivityOrder = function(params) {
	return post(model_course + `Activity/order`, params)
}
/**
 * 商品分类
 */
export const getProdClasses = function(params) {
	return get(model_course + `product/classList`, params)
}
/**
 *  收藏
 */
export const doCollect = function(params) {
	return post(model_course + `course/collect`, params)
}
/**
 *  我的收藏
 */
export const getCollectList = function(params) {
	return get(model_course + `user/collectedList`, params)
}
/**
 *  协议数据
 */
export const getAgreement = function(params) {
	// return get(model_course + `user/agreement`, params)
	return get(model_course + `merchant/agreement`, params)
}
/**
 *  关于我们
 */
export const getOurinfo = function(params) {
	// return get(model_course + `user/ourInfo`, params)
	return get(model_course + `merchant/ourInfo`, params)
}
/**
 * 权益
 */
export const getUserRights = function(params) {
	return get(model_course + `user/rights`, params)
}
/**
 * 用户信息
 */
export const getUserInfo = function(params) {
	return get(model_course + 'user/userInfo', params)
}
/**
 * 修改用户信息
 */
export const updateUser = function(params) {
	return post(model_course + 'user/update', params)
}
/**
 * 我的约课
 */
export const getMyBookCourse = function(params) {
	return get(model_course + 'user/about', params)
}
/**
 * 约课
 */
export const bookCourse = function(params) {
	return post(model_course + 'course/about', params)
}
/**
 * 排课列表
 */
export const getCourseSchedule = function(params) {
	return get(model_course + 'course/courseSchedule', params)
}


/**
 * 产品分类
 */
export const getProductTypeList = function(params) {
	return get(model_course + 'product/classList', params)
}

/**
 * 产品列表
 */
export const getProductList = function(params) {
	return get(model_course + 'product/list', params)
}

/**
 * 产品详情
 */
export const getProductDetail = function(params) {
	return get(model_course + 'product/detail', params)
}

/**
 * 产品下单
 */
export const createProductOrder = function(params) {
	return post(model_course + 'product/order', params)
}

/**
 * 新增留言
 * @returns
 */
export const addMessage = function(params) {
	return post(model_course + 'message/add', params)
}

/**
 * 团队列表
 * @returns
 */
export function getTeamList(params) {
	return get(model_course + 'team/list', params)
}

/**
 * 团队详情
 * @returns
 */
export function getTeamDetail(params) {
	return get(model_course + 'team/detail', params)
}

/**
 * 需求列表
 */
export const getCurrencyList = function(params) {
	return get(model_course + `enterpriseAssetsList`, params)
}
/**
 * 需求详情
 */
export const getCurrencyDetail = function(params) {
	return get(model_course + `enterpriseDemandDetail`, params)
}

/**
 * 需求下单
 */
export const createCurrencyOrder = function(params) {
	return post(model_course + 'enterpriseDemandOrder', params)
}

/**
 * 需求订单列表
 */
export const getCurrencyOrderList = function(params) {
	return get(model_course + 'enterpriseDemandOrderList', params)
}

/**
 * 需求订单详情
 */
export const getCurrencyOrderDetail = function(params) {
	return get(model_course + 'enterpriseDemandOrderDetail', params)
}


/**
 * 岗位列表
 */
export const getRecruitmentList = function(params) {
	return get(model_course + `recruitmentList`, params)
}
/**
 * 岗位详情
 */
export const getRecruitmentDetail = function(params) {
	return get(model_course + `recruitmentDetail`, params)
}

/**
 * 投递下单
 */
export const createRecruitmentOrder = function(params) {
	return post(model_course + 'recruitmentOrder', params)
}

/**
 * 岗位投递记录列表
 */
export const getrecRuitmentOrderList = function(params) {
	return get(model_course + 'recruitmentOrderList', params)
}

/**
 * 岗位投递记录详情
 */
export const getrecRuitmentOrderDetail = function(params) {
	return get(model_course + 'recruitmentOrderDetail', params)
}

/**
 * 案例列表
 */
export const getServiceCaseList = function(params) {
	return get(model_course + `serviceCaseList`, params)
}
/**
 * 案例详情
 */
export const getServiceCaseDetail = function(params) {
	return get(model_course + `serviceCaseDetail`, params)
}


/**
 * 发布ugc
 */
export const postCommunity = function(params) {
	return post(model_course + 'insertCommunity', params)
}

/**
 * ugc列表
 */
export const getUgcCommunityList = function(params) {
	return get(model_course + `getUgcCommunityList`, params)
}
/**
 * ugc详情
 */
export const getUgcCommunityInfo = function(params) {
	return get(model_course + `getUgcCommunityInfo`, params)
}
/**
 * ugc 添加浏览次数
 */
export const lookupNum = function(params) {
	return put(model_course + `lookupNum?ugcId=` + params.ugcId, params)
}

/**
 * ugc 添加分享次数
 */
export const forwardNum = function(params) {
	return put(model_course + `forwardNum?ugcId=` + params.ugcId, params)
}

/**
 * ugc 根据ID修改信息
 */
export const updateCommunity = function(params) {
	return put(model_course + `updateCommunity?id=` + params.id, params)
}

/**
 * ugc 添加点赞次数
 */
export const praiseUp = function(params) {
	return put(model_course + `praiseUp?ugcId=` + params.ugcId, params)
}

/**
 * ugc 取消点赞次数
 */
export const praiseDown = function(params) {
	return put(model_course + `praiseDown?ugcId=` + params.ugcId, params)
}

/**
 * ugc 评论列表
 */
export const selectUgcCommentList = function(params) {
	return get(model_course + `selectUgcCommentList`, params)
}

/**
 * ugc 发表评论
 */
export const commentUp = function(params) {
	return put(model_course + `commentUp?ugcId=` + params.ugcId + `&content= ` + params.content, params)
}


/**
 * 查询我发布的ugc
 */
export const getOwnerUgcCommunityList = function(params) {
	return get(model_course + `getOwnerUgcCommunityList`, params)
}

/**
 * 新增访客登记
 * @returns
 */
export const addSignIn = function(params) {
	return post(model_course + 'signInAdd', params)
}


/**
 * 查询访问记录
 */
export const getSignInList = function(params) {
	return get(model_course + `signInList`, params)
}


/**
 * 查询商户模块
 */
export const getMerchantModuleList = function(params) {
	return get(model_course + `merchant/moduleList`, params)
}

/**
 * 查询客户
 */
export const getCustomerList = function(params) {
	return get(model_course + `customerList`, params)
}

/**
 * 查询品牌
 */
export const getBrandStoryList = function(params) {
	return get(model_course + `brandStoryList`, params)
}

/**
 * 广告组件查询
 */
export const getAdvertList = function(params) {
	return get(model_course + `advert/list`, params)
}

/**
 * 广告组件点击
 */
export const clickAdvert = function(params) {
	return put(model_course + `advert/addLook`, params)
}

/**
 * 查询各种分类
 */
export const getAllClassify = function(params) {
	return get(model_course + `index/allClassify`, params)
}

/**
 * 查询积分商品列表
 */
export const getPointGoodList = function(params) {
	return get(model_course + `point/goodList`, params)
}

/**
 * 查询积分商品详情
 */
export const getPointGoodDetail = function(params) {
	return get(model_course + `point/queryGood`, params)
}

/**
 * 积分商品下单
 */
export const postPointGood = function(params) {
	return post(model_course + `point/order`, params)
}

/**
 * 查询用户剩余积分
 */
export const getPointBalance = function(params) {
	return get(model_course + `point/balance`, params)
}

/**
 * 查询用户积分记录
 */
export const getPointRecord = function(params) {
	return get(model_course + `point/recordList`, params)
}

/**
 * 查询积分订单列表
 */
export const getPointOrderList = function(params) {
	return get(model_course + `point/orderList`, params)
}

/**
 * 查询积分订单详情
 */
export const getPointOrderDetail = function(params) {
	return get(model_course + `point/queryOrder`, params)
}

/**
 * 查询积分配置
 */
export const getPointConfig = function(params) {
	return get(model_course + `point/getConfig`, params)
}

/**
 * 获取参数二维码
 */
export const getUnlimitedQRCode = function(params) {
	return post(model_course + `miniprogram/getUnlimitedQRCode/v2`, params)
}

/**
 * 获取查询模版消息
 */
export const getTemplateList = function(params) {
	return get(model_course + `index/templateList`, params)
}

/**
 * 获取查询物流信息
 */
export const queryExpressage = function(params) {
	return get(model_course + `queryExpressage`, params)
}

/**
 * 中转接口
 */
export const passGetMethod = function(params) {
	return get(model_course + `index/passGet`, params)
}

/**
 * 获取表单接口
 */
export const getFormModule = function(params) {
	return get(model_course + `index/getFormModuleList`, params)
}